package pojo.Homework

object Person03 {

  class Animals() {
    val name: String = "动物"

    def eat(): Unit = {
      println(name + "吃水果")
    }
  }

  class Cat extends Animals {
    override val name: String = "猫"

    override def eat(): Unit = {
      println(this.name + "吃鱼")
    }


  }

  def main(args: Array[String]): Unit = {
    val cat: Cat = new Cat()
    cat.eat()
  }
}
